
//**********主页************//
var nav = document.querySelectorAll(".nav-item");
var navv = document.querySelectorAll(".nav-item a");
var tab = document.querySelector("nav ul");
var tab1 = document.querySelector(".lip");
nav[0].addEventListener("mouseover",function(){
	navv[0].style.background = "#12b7f5";
	navv[1].style.background = "transparent";
	navv[2].style.background = "transparent";
})
nav[1].addEventListener("mouseover",function(){
	navv[1].style.background = "#12b7f5";
	navv[0].style.background = "transparent";
	navv[2].style.background = "transparent";
})
nav[2].addEventListener("mouseover",function(){
	navv[0].style.background = "transparent";
	navv[2].style.background = "#12b7f5";
	navv[1].style.background = "transparent";
})
tab.addEventListener("mouseout",function(){
		navv[1].style.background = "#12b7f5";
		navv[0].style.background = "transparent";
		navv[2].style.background = "transparent";
})

   
//footer 划过
var nb = document.querySelectorAll(".box");
var bn = document.querySelectorAll(".boxp")
nb[0].addEventListener("mouseover",function(){
		bn[0].style.color = "#12B8F6";
})
nb[0].addEventListener("mouseout",function(){
	bn[0].style.color = "#666";
})
nb[1].addEventListener("mouseover",function(){
		bn[1].style.color = "#12B8F6";
})
nb[1].addEventListener("mouseout",function(){
	bn[1].style.color = "#666";
})
nb[2].addEventListener("mouseover",function(){
		bn[2].style.color = "#12B8F6";
})
nb[2].addEventListener("mouseout",function(){
	bn[2].style.color = "#666";
})
nb[3].addEventListener("mouseover",function(){
		bn[3].style.color = "#12B8F6";
})
nb[3].addEventListener("mouseout",function(){
	bn[3].style.color = "#666";
})


//高楼效果
var sw = document.querySelector("#toTop");
var t = document.querySelector("#nanav");
if(document.body.offsetWidth>'687'){
	sw.addEventListener("mouseover",function(){
		sw.style.backgroundImage= "url(images/timg2.gif)";
	})
	sw.addEventListener("mouseout",function(){
		sw.style.backgroundImage= "url(images/timg21.gif)";
	})
}
window.onscroll = function(	){
	if(document.documentElement.scrollTop > 800 || document.body.scrollTop > 800){
		t.style.position = "fixed";
		t.style.background = "#fff";
		t.style.zIndex = "999";
		t.style.width = "100%";
	}else{
		t.style.position = "relative";
		t.style.background = "transparent";
	};
	if(document.documentElement.scrollTop > 500 || document.body.scrollTop > 500){
		sw.style.display = "block";
	}else{
		sw.style.display = "none";
		sw.style.bottom = "50px";
		
	}
	sw.addEventListener('click',function(){
		sw.style.bottom = "200px";
		window.scrollTo({
			top:0,
			behavior:'smooth'
		})
	})
}

